package com.action.member;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.controller.Action;
import com.dao.MemberDao;

public class AdminDeleteProAction implements Action{
	@Override
	public String execute(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		HttpSession session = request.getSession();
		String session_id = (String)session.getAttribute("mem_id");
		if(!session_id.equals("admin")){
			return "/view/member/main.jsp";
		}
		String search_id = request.getParameter("search_id");
		MemberDao dao = MemberDao.getinstance();
		dao.deleteMember(search_id);
		
		return "/view/member/adminDeletePro.jsp";
	}
}
